#pragma once

#include "dua_def.h"

enum {
	TARGET_TEMP,
	TARGET_NAME,
	TARGET_CONST,
};

enum {
	ORDER_K,
	ORDER_LET,
	ORDER_VALUE,
	ORDER_CAST,
	ORDER_ARITH,
	ORDER_IF,
	ORDER_ELSE,
	ORDER_ENDIF,
	ORDER_PRINT,
};

typedef struct {
	int t;
	int type;
	union {
		DuaString* name;
		unsigned index;
		DuaValue value;
	};
}DuaTarget;

typedef struct {
	int order;
	int tk;
	DuaTarget res;
	DuaTarget v1;
	DuaTarget v2;
}DuaOrder;


extern DuaProto*
duaLoadOrder(DuaState* D, const char* str, size_t len);